<template>
  <div class="page">
    <el-scrollbar class="Yscrollbar" style="height: calc(100% - 8vh)">
      <LabelContent title="实名认证审核" ref="LabelContent"> </LabelContent>
      <el-form :inline="true" class="arrange-form" size="small" style="text-align: left">
        <el-col :span="6">
          <el-form-item style="margin-left: 1vw; margin-top: 1vw" label="真实姓名：">
            <p>{{ item }}</p>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item style="margin-left: 1vw" label="身份证号：">
            <p>身份证号</p>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item style="margin-left: 1vw" label="毕业照或录取通知书图片：">
            <div v-if="items.hasOwnProperty('files')" class="flex">
              <div v-for="item in items.files" :key="item.updId">
                <el-image :preview-src-list="items['srcList']" :src="item.updUrl"></el-image>
              </div>
            </div>
            <img v-else style="width: 10vw; height: 10vw" src="../../assets/imgs/diushi.png" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item style="margin-left: 1vw" label="相关证件照片：">
            <div v-if="items.hasOwnProperty('files')" class="flex">
              <div v-for="item in items.files" :key="item.updId">
                <el-image :preview-src-list="items['srcList']" :src="item.updUrl"></el-image>
              </div>
            </div>
            <img v-else style="width: 10vw; height: 10vw" src="../../assets/imgs/diushi.png" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="审核：" style="margin-left: 1vw" class="stywid stywid1">
            <el-radio v-model="Submitquery.auditStatus" label="success" value="success"
              >通过</el-radio
            >
            <el-radio v-model="Submitquery.auditStatus" label="fail" value="fail">驳回</el-radio>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item style="margin-left: 1vw" label="备注:">
            <el-input
              :rows="3"
              :cols="1"
              placeholder="请输入内容"
              v-model="Submitquery.remark"
              type="textarea"
            />
          </el-form-item>
        </el-col>
      </el-form>
    </el-scrollbar>
    <div class="bottomBtnBox">
      <el-button class="long" @click="submit" type="primary" size="small">提交</el-button>
      <el-button class="long" @click="cancel" type="info" size="small">取消</el-button>
    </div>
  </div>
</template>
<script>
export default {
  name: "TestPage_detail",
  data () {
    return {
      items: {},
      Submitquery: {
        userId: 0,
        auditStatus: "success",
        remark: "",
      }
    }
  },
  mounted () {
    let { userId } = this.$route.params
    this.Submitquery.userId = userId
    this.init()
  },
  methods: {
    //   获得数据
    async init () {
      let { data } = await this.$http
        .request({
          url: "/hw/admin/user/detail/?userId=" + this.Submitquery.userId,
          method: "GET",
          showLoading: true,
        })
      if (data.hasOwnProperty('files')) {
        let srcList = data.files.map(x => x.updUrl)
        data["srcList"] = srcList
      }
      this.items = data
    },
    async test () {
      this.$http
        .request({
          url: "https://www.baidu.com/sugrec",
          method: "GET",
          showLoading: true,
          params: {},
        })
        .then((resp) => { })
        .catch(() => { })
    },

    // 保存
    async submit () {
      let data = await this.$http
        .request({
          url: "/hw/admin/articles/daily_share/audit/" + this.Submitquery.userId,
          method: "POST",
          params: this.Submitquery,
          showLoading: true,
        })
      if (data.status == 100) {
        this.$message({
          message: '审核成功',
          type: 'success'
        })

        this.jump("/shareControl")
      }
    },
    cancel () {
      this.jump("/shareControl")
    },
  },
};
</script>

<style lang="scss" scoped>
.el-col-6 {
  width: 100%;
}
</style>
